#! /bin/bash

if [ ! -f $target/etc/resolv.conf ]; then
    cp /etc/resolv.conf $target/etc
fi

if [ -n "$YUMPROXY" ]; then
    ainsl /etc/dnf/dnf.conf "proxy=$YUMPROXY"
fi

#sed -i /^distroverpkg/a\color=always $target/etc/yum.conf
#sed -i /^distroverpkg/a\async=true $target/etc/yum.conf
#sed -i /^distroverpkg/a\deltarpm=0 $target/etc/yum.conf
#sed -i s/^mirrorlist/#mirrorlist/ $target/etc/yum.repos.d/epel.repo
#sed -i s/^#baseurl/baseurl/ $target/etc/yum.repos.d/epel.repo
#sed -i '6 s/^enabled.*$/enabled=1/' $target/etc/yum.repos.d/epel.repo
#sed -i s/^mirrorlist/#mirrorlist/ $target/etc/yum.repos.d/remi*
#sed -i s/^#baseurl/baseurl/ $target/etc/yum.repos.d/remi*

#for grub and zfs
mount -o bind /dev $target/dev

if [ X$verbose = X1 ]; then
	echo "Updating base"
	$ROOTCMD dnf -y update |& tee -a $LOGDIR/software.log
else
	$ROOTCMD dnf -y update >> $LOGDIR/software.log
fi

skiptask updatebase
